package com.template.domain.param;

import com.template.common.lang.Regexp;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

public class UserParams {

    @Getter
    @Setter
    public static class UpdatePwd {

        @NotBlank(message = "密码不能为空")
        private String oldPassword;

        @Size(min = 6, max = 20, message = "密码长度必须在6到20位之间")
        @NotBlank(message = "密码不能为空")
        private String newPassword;
    }

    @Getter
    @Setter
    public static class UpdateBasic {
        @NotNull(message = "用户id为必要参数")
        private Long id;

        @NotBlank(message = "昵称不能为空")
        private String nickname;

        private String phone;

        private String email;

        private String signature;

        private String area;
    }

    @Getter
    @Setter
    public static class Repass {

        @NotNull(message = "用户id为必传项")
        private Long id;

        @Pattern(regexp = Regexp.PASSWORD, message = "密码必须为6-18位数字/字符/符号的组合")
        private String password;
    }

    @Getter
    @Setter
    public static class Assign {
        @NotNull(message = "用户id为必传项")
        private Long userId;
        private List<Long> roleIds;
    }
}
